SlideShare a Scribd company logo
Struts 2 DATA Tags
What are DATA Tags ? Focus on ways to extract data from ValueStack.  Manipulate ValueStack via set and push. Provides many types pf tags as a, action, debug,i18n, include, param, property, push, set, text, url, bean.
Type of DATA Tags 1. Action :  Calls an action from within a page, and can be configured to render the results. Also used as dynamic include. Ex : <s:action name=&quot;actionTagAction&quot; executeResult=&quot;true&quot; />  2. I18n :  Places additional resource bundles on the stack to use for internationalization text. Ex : <s:i18n name=&quot;myCustomBundle&quot;> The i18n value for key aaa.bbb.ccc in myCustomBundle is <s:property value=&quot;text('aaa.bbb.ccc')&quot; /> </s:i18n>   3. Push :  Pushes a value on to the value stack. Ex : <s:push value=&quot;user&quot;> <s:propery value=&quot;firstName&quot; /> <s:propery value=&quot;lastName&quot; /> </s:push>   4. Set :  Takes a value from the value stack and sets it as an attribute under a specific HTTP scope (application, session, request,page or action). Ex : <s:set name=&quot;personName&quot; value=&quot;person.name&quot;/> Hello, <s:property value=&quot;#personName&quot;/>. How are you?  Contd….
Type of DATA Tags 5. Date :  Formats a Date object. Ex : <s:date name=&quot;person.birthday&quot; format=&quot;dd/MM/yyyy&quot; />   6. Include :  Makes a call and dynamically includes the result in the current page. Ex : <s:include value=&quot;myJsp.jsp&quot;> <s:param name=&quot;param1&quot; value=&quot;value2&quot; /> <s:param name=&quot;param2&quot; value=&quot;value2&quot; /> </s:include>   7. Text :  Retrieves a text value from a resource bundle for a specified key.. Ex : <s:text name=&quot;format.money&quot;><s:param name=&quot;value&quot; value=&quot;myMoneyValue&quot;/></s:text>   8. URL :  Generates a valid URL (including the servlet context or any portlet information) assigning it to an id in the value stack. Ex : <s:url value=&quot;editGadget.action&quot;> <s:param name=&quot;id&quot; value=&quot;%{selected}&quot; /> </s:url>   etc…. … .Contd.
Done! Click the  icon at the bottom to proceed!

More Related Content

More from Krazy Koder (20)

PPT
2310 b xd
Krazy Koder
 
PPT
2310 b xd
Krazy Koder
 
PPT
2310 b xd
Krazy Koder
 
PPT
2310 b xc
Krazy Koder
 
PPT
2310 b xb
Krazy Koder
 
PPT
2310 b 17
Krazy Koder
 
PPT
2310 b 16
Krazy Koder
 
PPT
2310 b 16
Krazy Koder
 
PPT
2310 b 15
Krazy Koder
 
PPT
2310 b 15
Krazy Koder
 
PPT
2310 b 14
Krazy Koder
 
PPT
2310 b 13
Krazy Koder
 
PPT
2310 b 12
Krazy Koder
 
PPT
2310 b 11
Krazy Koder
 
PPT
2310 b 10
Krazy Koder
 
PPT
2310 b 09
Krazy Koder
 
PPT
2310 b 08
Krazy Koder
 
PPT
2310 b 08
Krazy Koder
 
PPT
2310 b 08
Krazy Koder
 
PPT
2310 b 07
Krazy Koder
 
2310 b xd
Krazy Koder
 
2310 b xd
Krazy Koder
 
2310 b xd
Krazy Koder
 
2310 b xc
Krazy Koder
 
2310 b xb
Krazy Koder
 
2310 b 17
Krazy Koder
 
2310 b 16
Krazy Koder
 
2310 b 16
Krazy Koder
 
2310 b 15
Krazy Koder
 
2310 b 15
Krazy Koder
 
2310 b 14
Krazy Koder
 
2310 b 13
Krazy Koder
 
2310 b 12
Krazy Koder
 
2310 b 11
Krazy Koder
 
2310 b 10
Krazy Koder
 
2310 b 09
Krazy Koder
 
2310 b 08
Krazy Koder
 
2310 b 08
Krazy Koder
 
2310 b 08
Krazy Koder
 
2310 b 07
Krazy Koder
 

Recently uploaded (20)

PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Digital Circuits, important subject in CS
contactparinay1
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Ad

Krazykoder struts2 data_tags

  • 2. What are DATA Tags ? Focus on ways to extract data from ValueStack. Manipulate ValueStack via set and push. Provides many types pf tags as a, action, debug,i18n, include, param, property, push, set, text, url, bean.
  • 3. Type of DATA Tags 1. Action : Calls an action from within a page, and can be configured to render the results. Also used as dynamic include. Ex : <s:action name=&quot;actionTagAction&quot; executeResult=&quot;true&quot; /> 2. I18n : Places additional resource bundles on the stack to use for internationalization text. Ex : <s:i18n name=&quot;myCustomBundle&quot;> The i18n value for key aaa.bbb.ccc in myCustomBundle is <s:property value=&quot;text('aaa.bbb.ccc')&quot; /> </s:i18n> 3. Push : Pushes a value on to the value stack. Ex : <s:push value=&quot;user&quot;> <s:propery value=&quot;firstName&quot; /> <s:propery value=&quot;lastName&quot; /> </s:push> 4. Set : Takes a value from the value stack and sets it as an attribute under a specific HTTP scope (application, session, request,page or action). Ex : <s:set name=&quot;personName&quot; value=&quot;person.name&quot;/> Hello, <s:property value=&quot;#personName&quot;/>. How are you? Contd….
  • 4. Type of DATA Tags 5. Date : Formats a Date object. Ex : <s:date name=&quot;person.birthday&quot; format=&quot;dd/MM/yyyy&quot; /> 6. Include : Makes a call and dynamically includes the result in the current page. Ex : <s:include value=&quot;myJsp.jsp&quot;> <s:param name=&quot;param1&quot; value=&quot;value2&quot; /> <s:param name=&quot;param2&quot; value=&quot;value2&quot; /> </s:include> 7. Text : Retrieves a text value from a resource bundle for a specified key.. Ex : <s:text name=&quot;format.money&quot;><s:param name=&quot;value&quot; value=&quot;myMoneyValue&quot;/></s:text> 8. URL : Generates a valid URL (including the servlet context or any portlet information) assigning it to an id in the value stack. Ex : <s:url value=&quot;editGadget.action&quot;> <s:param name=&quot;id&quot; value=&quot;%{selected}&quot; /> </s:url> etc…. … .Contd.
  • 5. Done! Click the icon at the bottom to proceed!